import java.net.MalformedURLException;
import java.util.List;

import redstone.xmlrpc.XmlRpcFault;
import net.bican.wordpress.Blog;
import net.bican.wordpress.Page;
import net.bican.wordpress.PageDefinition;
import net.bican.wordpress.Wordpress;

/**
Autore:Stefano Ricciardi
Rilasciato sotto licenza GNU LGPL 3.0
*/

public class ProvaLoginWordpress {

	public static void main(String[] args)throws MalformedURLException, XmlRpcFault
   {
  String username = "user";
  String password = "password";
  String xmlRpcUrl = "http://www.nomesito.it/xmlrpc.php";
  Wordpress wp = new Wordpress(username, password, xmlRpcUrl);
  System.out.println(wp.getUserInfo());
  
  /*List<Page> recentPosts;

	recentPosts = wp.getRecentPosts(10);

  System.out.println("Here are the ten recent posts:");
  for (Page page : recentPosts) {
    System.out.println(page.getPostid() + ":" + page.getTitle());
  }
  List<PageDefinition> pages = wp.getPageList();
  System.out.println("Here are the pages:");
  for (PageDefinition pageDefinition : pages) {
    System.out.println(pageDefinition.getPage_title());
  }
  System.out.println("Posting a test (draft) page from a previous page...");
  Page recentPost = wp.getRecentPosts(1).get(0);
  recentPost.setTitle("Test Page");
  recentPost.setDescription("Test description");
  String result = wp.newPost(recentPost, false);
  System.out.println("new post page id: " + result);
  System.out.println("\nThat's all for now.");*/
 // System.out.println(wp.supportedMethods());
  //Blog b=null;
  
}
}
